package multithread;

/**
 * Created by xiebang
 * Description
 * User:小谢
 * Date:2021-12-01
 * Time:18:06
 */
public class ThreadDemo2 {
//    static class MyRunnable implements Runnable{
//        @Override
//        public void run() {
//            System.out.println("我是一个新线程");
//        }
//    }
//    public static void main(String[] args) {
//        Thread t = new Thread(new MyRunnable());
//        t.start();
//    }
//public static void main(String[] args) {
//    Runnable runnable = new Runnable() {
//        @Override
//        public void run() {
//            System.out.println("这是一个新线程");
//        }
//    };
//    Thread thread = new Thread(runnable);
//    thread.start();
//}
public static void main(String[] args) {
    Thread t = new Thread(() ->{
        System.out.println("我是一个新线程!");
    });
    t.start();
}
}
